import request from "@/utils/request";

enum API {
    TRADEMARK_URL = '/admin/product/baseTrademark/',
    ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
    UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update',
    DELETE_URL = '/admin/product/baseTrademark/remove/'
}

// 获取已有品牌的接口
export const reqTrademark = (page: any, limit: any) => request.get<any, any>(API.TRADEMARK_URL + `${page}/${limit}`)

// 添加与修改已有品牌的接口
export const reqAddOrUpdateTrademark = (data: any) => {
    if (data.id) {
        return request.put<any, any>(API.UPDATETRADEMARK_URL, data)
    } else {
        return request.post<any, any>(API.ADDTRADEMARK_URL, data)
    }
}

// 删除已有品牌的数据
export const reqDeleteTrademark = (id: number) => request.delete<any, any>(API.DELETE_URL + id)


































